#ifndef SOCKETMESSAGE_H
#define SOCKETMESSAGE_H

#include <SDL.h>
#include <SDL_net.h>
#include <string>
#include <vector>

class SocketMessage
{
public:
	SocketMessage();
	void Clear();
	const unsigned char* GetData() const;
	const int GetLength() const;
	void Append(unsigned char* data, unsigned char* length);

	bool ReadFloat(float* data);
	bool ReadInt(int* data);
	bool ReadString(std::string* data);

	void WriteFloat(float f);
	void WriteInt(int i);
	void WriteString(const std::string& s);

private:
	//std::string m_message;
	//int m_messageLength;
	std::vector<unsigned char> m_chars;
	unsigned int m_dataIndex;
};

#endif //SOCKETMESSAGE_H